<?php
/**
 * Created by PhpStorm.
 * User: EZ
 * Date: 2017/5/25
 * Time: 14:18
 */
//require "Action.php";
namespace app\index\controller;
use core\Route;
class Ajax extends  Route{
    public function index(){


        $this->assign('a','赵大伟');
        $this->assign('bbb',123456);
//        $a="赵大伟";
        $this->display('ajax');
    }

    public function roback(){
        $callback = isset($_GET['callback']) ? trim($_GET['callback']) : ''; //jsonp回调参数，必需
        $date = array("age"=>$_GET['age'], "message"=>$_GET['age']);
        $date["msg"]="err";
        $date["info"]="因人品问题，发送失败";
        $tmp= json_encode($date); //json 数据
        echo $callback . '(' . $tmp .')';  //返回格式，必需

    }
    public function img(){

        $this->display('img');
    }
}